﻿using aier.business.logic;
using aier.dataaccess.model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;

namespace aier.wx.api.selfhost.Controllers
{
    //[Authorize]
    [RoutePrefix("api/Content")]
    public class ContentController : ApiController
    {
        public ContentBll contentBll { get; set; }
        /// <summary>
        /// 获取所有筛查内容
        /// 原程序 ScContentServiceImpl/getAll
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [ActionName("GetAllContentInfo")]
        public IHttpActionResult GetAllContentInfo()
        {
            List<ContentView> contentViews = null;
            contentViews = contentBll.GetAllContentInfo();
            return Ok<List<ContentView>>(contentViews);
        }
        /// <summary>
        /// 根据筛查内容ID获取筛查内容
        /// 查询条件：筛查内容ID
        /// 原程序 ScContentServiceImpl/getById
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [ActionName("GetContentInfoById")]
        public IHttpActionResult GetContentInfoById(string ContentId)
        {
            ContentView contentView = null;
            contentView = contentBll.GetContentInfoById(ContentId);
            return Ok<ContentView>(contentView);
        }
    }
}
